/*
 * @file:start.S
 */

#define WTCON           0xE2700000
#define SVC_STACK       0xD0037D80
#define PS_HOLD_CONTROL 0xE010E81C

.global _start
_start:
    //给5V电源置锁
    ldr r0, = PS_HOLD_CONTROL
    ldr r1, [r0]
    orr r1, r1, #0x300
    orr r1, r1, #0x1
    str r1, [r0]

    //关看门狗
    ldr r0, = WTCON
    ldr r1, = 0x0
    str r1, [r0]

    //设置SVC栈
    ldr sp, = SVC_STACK

    //开iCache
    mrc p15, 0, r0, c1, c0, 0;
    orr r0, r0, #(1<<12)
    mcr p15, 0, r0, c1, c0, 0;

    bl main

    b .
